/**
 * Copyright © 2011 Software in Life Inc. All rights reserved.
 */
package com.softwareinlife.restful.server.alarm.model;

import java.io.Serializable;
import java.util.Date;
import java.util.logging.Logger;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

/**
 * <b>RESTful Web Service Model for Alarm Information</b>
 * 
 * @author Jang, Sun-Jin(jangsunjin@softwareinlife.com)
 */
@PersistenceCapable
@XmlRootElement(name = "alarm")
@XmlAccessorType(XmlAccessType.FIELD)
public class AlarmModel implements Serializable {

	/**
	 * Serial Version UID
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * Logger
	 */
	protected static Logger logger = Logger.getLogger("model");

	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	@XmlElement(name = "alarmSeq")
	private Long alarmSeq;

	@Persistent
	@XmlElement(name = "alarmType")
	private String alarmType = "1";

	@Persistent
	@XmlElement(name = "alarmDate")
	private String alarmDate;

	@Persistent
	@XmlElement(name = "description")
	private String description;

	@Persistent
	@XmlElement(name = "alarmLevel")
	private String alarmLevel;

	@Persistent
	@XmlElement(name = "createdDate")
	private Date createdDate;

	/**
	 * Constructor
	 */
	public AlarmModel() {
		super();

		createdDate = new Date();
	}

	/**
	 * Constructor
	 * 
	 * @param alarmSeq
	 * @param alarmType
	 * @param alarmDate
	 * @param description
	 * @param alarmLevel
	 * @param createdDate
	 */
	public AlarmModel(Long alarmSeq, String alarmType, String alarmDate,
			String description, String alarmLevel, Date createdDate) {
		super();
		this.alarmSeq = alarmSeq;
		this.alarmType = alarmType;
		this.alarmDate = alarmDate;
		this.description = description;
		this.alarmLevel = alarmLevel;

		createdDate = new Date();
	}

	/**
	 * @return the alarmSeq
	 */
	public Long getAlarmSeq() {
		return alarmSeq;
	}

	/**
	 * @param alarmSeq
	 *            the alarmSeq to set
	 */
	public void setAlarmSeq(Long alarmSeq) {
		this.alarmSeq = alarmSeq;
	}

	/**
	 * @return the alarmType
	 */
	public String getAlarmType() {
		return alarmType;
	}

	/**
	 * @param alarmType
	 *            the alarmType to set
	 */
	public void setAlarmType(String alarmType) {
		this.alarmType = alarmType;
	}

	/**
	 * @return the alarmDate
	 */
	public String getAlarmDate() {
		return alarmDate;
	}

	/**
	 * @param alarmDate
	 *            the alarmDate to set
	 */
	public void setAlarmDate(String alarmDate) {
		this.alarmDate = alarmDate;
	}

	/**
	 * @return the description
	 */
	public String getDescription() {
		return description;
	}

	/**
	 * @param description
	 *            the description to set
	 */
	public void setDescription(String description) {
		this.description = description;
	}

	/**
	 * @return the alarmLevel
	 */
	public String getAlarmLevel() {
		return alarmLevel;
	}

	/**
	 * @param alarmLevel
	 *            the alarmLevel to set
	 */
	public void setAlarmLevel(String alarmLevel) {
		this.alarmLevel = alarmLevel;
	}

	/**
	 * @return the createdDate
	 */
	public Date getCreatedDate() {
		return createdDate;
	}

	/**
	 * @param createdDate
	 *            the createdDate to set
	 */
	public void setCreatedDate(Date createdDate) {
		this.createdDate = createdDate;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "AlarmModel [alarmSeq=" + alarmSeq + ", alarmType=" + alarmType
				+ ", alarmDate=" + alarmDate + ", description=" + description
				+ ", alarmLevel=" + alarmLevel + ", createdDate=" + createdDate
				+ "]";
	}

}
